using System;
using System.Collections;
using System.Data;
using System.Data.Common;
using OracleInternal.Common;

namespace Oracle.ManagedDataAccess.Client
{
	public sealed class OracleParameterCollection : DbParameterCollection
	{
		internal ArrayList m_array;

		public new OracleParameter this[string name]
		{
			get
			{
				int num = -1;
				if ((num = FindParamByName(name)) != -1)
				{
					return this[num];
				}
				return null;
			}
			set
			{
				if (value == null)
				{
					throw new ArgumentNullException();
				}
				if (value.m_collRef == null)
				{
					int num = FindParamByName(name);
					if (num >= 0)
					{
						m_array[num] = value;
						value.m_collRef = this;
						return;
					}
					throw new ArgumentException("name");
				}
				throw new ArgumentException(OracleStringResourceManager.GetErrorMesg(ResourceStringConstants.PRMCOL_ALREADY_ADDED));
			}
		}

		public new OracleParameter this[int index]
		{
			get
			{
				return m_array[index] as OracleParameter;
			}
			set
			{
				if (value == null)
				{
					throw new ArgumentNullException();
				}
				if (value.m_collRef == null)
				{
					m_array[index] = value;
					value.m_collRef = this;
					return;
				}
				throw new ArgumentException(OracleStringResourceManager.GetErrorMesg(ResourceStringConstants.PRMCOL_ALREADY_ADDED));
			}
		}

		public override bool IsFixedSize => m_array.IsFixedSize;

		public override bool IsReadOnly => m_array.IsReadOnly;

		public override int Count => m_array.Count;

		public override bool IsSynchronized => m_array.IsSynchronized;

		public override object SyncRoot => m_array.SyncRoot;

		internal OracleParameterCollection()
		{
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.ctor);
			}
			try
			{
				m_array = new ArrayList();
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPrivate)
				{
					Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.ctor);
				}
			}
		}

		internal OracleParameterCollection(ArrayList array)
		{
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.ctor);
			}
			try
			{
				m_array = array;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Private, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.ctor, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPrivate)
				{
					Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.ctor);
				}
			}
		}

		public override bool Contains(string parameterName)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Contains);
			}
			try
			{
				return FindParamByName(parameterName) != -1;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Contains, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Contains);
				}
			}
		}

		public override int IndexOf(string parameterName)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.IndexOf);
			}
			try
			{
				return FindParamByName(parameterName);
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.IndexOf, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.IndexOf);
				}
			}
		}

		public override void RemoveAt(string parameterName)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.RemoveAt);
			}
			try
			{
				int num = FindParamByName(parameterName);
				if (num >= 0)
				{
					((OracleParameter)m_array[num]).m_collRef = null;
					m_array.RemoveAt(num);
					return;
				}
				throw new ArgumentException();
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.RemoveAt, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.RemoveAt);
				}
			}
		}

		public override int Add(object obj)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
			}
			try
			{
				if (obj == null)
				{
					throw new ArgumentNullException();
				}
				OracleParameter oracleParameter = (OracleParameter)obj;
				if (oracleParameter.m_collRef != null)
				{
					throw new ArgumentException(OracleStringResourceManager.GetErrorMesg(ResourceStringConstants.PRMCOL_ALREADY_ADDED));
				}
				int result = m_array.Add(oracleParameter);
				oracleParameter.m_collRef = this;
				return result;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
				}
			}
		}

		public OracleParameter Add(OracleParameter param)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
			}
			try
			{
				if (param == null)
				{
					throw new ArgumentNullException("param");
				}
				if (param.m_collRef != null)
				{
					throw new ArgumentException(OracleStringResourceManager.GetErrorMesg(ResourceStringConstants.PRMCOL_ALREADY_ADDED));
				}
				m_array.Add(param);
				param.m_collRef = this;
				return param;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
				}
			}
		}

		public OracleParameter Add(string name, object val)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
			}
			try
			{
				return Add(new OracleParameter(name, val));
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
				}
			}
		}

		public OracleParameter Add(string name, OracleDbType dbType)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
			}
			try
			{
				return Add(new OracleParameter(name, dbType));
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
				}
			}
		}

		public OracleParameter Add(string name, OracleDbType dbType, ParameterDirection direction)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
			}
			try
			{
				return Add(new OracleParameter(name, dbType, direction));
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
				}
			}
		}

		public OracleParameter Add(string name, OracleDbType dbType, object val, ParameterDirection dir)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
			}
			try
			{
				return Add(new OracleParameter(name, dbType, val, dir));
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
				}
			}
		}

		public OracleParameter Add(string name, OracleDbType dbType, int size, object val, ParameterDirection dir)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
			}
			try
			{
				return Add(new OracleParameter(name, dbType, size, val, dir));
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
				}
			}
		}

		public OracleParameter Add(string name, OracleDbType dbType, int size)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
			}
			try
			{
				return Add(new OracleParameter(name, dbType, size));
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
				}
			}
		}

		public OracleParameter Add(string name, OracleDbType dbType, int size, string srcColumn)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
			}
			try
			{
				return Add(new OracleParameter(name, dbType, size, srcColumn));
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
				}
			}
		}

		public OracleParameter Add(string name, OracleDbType dbType, int size, ParameterDirection dir, bool isNullable, byte precision, byte scale, string srcColumn, DataRowVersion version, object val)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
			}
			try
			{
				return Add(new OracleParameter(name, dbType, size, dir, isNullable, precision, scale, srcColumn, version, val));
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Add);
				}
			}
		}

		public override void Clear()
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Clear);
			}
			try
			{
				for (int i = 0; i < m_array.Count; i++)
				{
					((OracleParameter)m_array[i]).m_collRef = null;
				}
				m_array.Clear();
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Clear, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Clear);
				}
			}
		}

		public override bool Contains(object item)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Contains);
			}
			try
			{
				return m_array.Contains((OracleParameter)item);
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Contains, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Contains);
				}
			}
		}

		public override int IndexOf(object obj)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.IndexOf);
			}
			try
			{
				return m_array.IndexOf((OracleParameter)obj);
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.IndexOf, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.IndexOf);
				}
			}
		}

		public override void Insert(int index, object obj)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Insert);
			}
			try
			{
				if (obj == null)
				{
					throw new ArgumentNullException();
				}
				OracleParameter oracleParameter = (OracleParameter)obj;
				if (oracleParameter.m_collRef != null)
				{
					throw new ArgumentException(OracleStringResourceManager.GetErrorMesg(ResourceStringConstants.PRMCOL_ALREADY_ADDED));
				}
				m_array.Insert(index, oracleParameter);
				oracleParameter.m_collRef = this;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Insert, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Insert);
				}
			}
		}

		public override void Remove(object obj)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Remove);
			}
			try
			{
				if (obj == null)
				{
					throw new ArgumentNullException("obj");
				}
				int num = m_array.IndexOf((OracleParameter)obj);
				if (num >= 0)
				{
					((OracleParameter)m_array[num]).m_collRef = null;
					m_array.RemoveAt(num);
					return;
				}
				throw new ArgumentException();
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Remove, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.Remove);
				}
			}
		}

		public override void RemoveAt(int index)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.RemoveAt);
			}
			try
			{
				((OracleParameter)m_array[index]).m_collRef = null;
				m_array.RemoveAt(index);
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.RemoveAt, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.RemoveAt);
				}
			}
		}

		public override void CopyTo(Array array, int index)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.CopyTo);
			}
			try
			{
				m_array.CopyTo(array, index);
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.CopyTo, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.CopyTo);
				}
			}
		}

		public override IEnumerator GetEnumerator()
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.GetEnumerator);
			}
			try
			{
				return m_array.GetEnumerator();
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.GetEnumerator, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.GetEnumerator);
				}
			}
		}

		public override void AddRange(Array paramArray)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.AddRange);
			}
			try
			{
				if (paramArray == null)
				{
					throw new ArgumentNullException();
				}
				foreach (OracleParameter item in paramArray)
				{
					_ = item;
				}
				foreach (OracleParameter item2 in paramArray)
				{
					m_array.Add(item2);
				}
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.AddRange, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.AddRange);
				}
			}
		}

		protected override DbParameter GetParameter(int index)
		{
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.GetParameter);
			}
			try
			{
				return m_array[index] as DbParameter;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Private, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.GetParameter, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPrivate)
				{
					Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.GetParameter);
				}
			}
		}

		protected override DbParameter GetParameter(string parameterName)
		{
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.GetParameter);
			}
			try
			{
				int num = -1;
				if ((num = FindParamByName(parameterName)) != -1)
				{
					return this[num];
				}
				return null;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Private, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.GetParameter, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPrivate)
				{
					Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.GetParameter);
				}
			}
		}

		protected override void SetParameter(int index, DbParameter value)
		{
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.SetParameter);
			}
			try
			{
				m_array[index] = value as OracleParameter;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Private, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.SetParameter, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPrivate)
				{
					Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.SetParameter);
				}
			}
		}

		protected override void SetParameter(string parameterName, DbParameter value)
		{
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.SetParameter);
			}
			try
			{
				int num = FindParamByName(parameterName);
				if (num < 0 || num >= m_array.Count)
				{
					throw new ArgumentException("parameterName");
				}
				m_array[num] = value;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Private, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.SetParameter, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPrivate)
				{
					Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.SetParameter);
				}
			}
		}

		private int FindParamByName(string name)
		{
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.FindParamByName);
			}
			try
			{
				int count = m_array.Count;
				for (int i = 0; i < count; i++)
				{
					if (((OracleParameter)m_array[i]).ParameterName.Length >= 1 && ((OracleParameter)m_array[i]).ParameterName[0] == '"')
					{
						if (((OracleParameter)m_array[i]).ParameterName == name)
						{
							return i;
						}
					}
					else if (string.Compare(((OracleParameter)m_array[i]).ParameterName, name, ignoreCase: true) == 0)
					{
						return i;
					}
				}
				return -1;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Private, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.FindParamByName, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPrivate)
				{
					Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.FindParamByName);
				}
			}
		}

		internal int FindLastParamByName(string name)
		{
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Entry, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.FindLastParamByName);
			}
			try
			{
				for (int num = m_array.Count - 1; num >= 0; num--)
				{
					if (((OracleParameter)m_array[num]).ParameterName.Length >= 1 && ((OracleParameter)m_array[num]).ParameterName[0] == '"')
					{
						if (((OracleParameter)m_array[num]).ParameterName == name)
						{
							return num;
						}
					}
					else if (string.Compare(((OracleParameter)m_array[num]).ParameterName, name, ignoreCase: true) == 0)
					{
						return num;
					}
				}
				return -1;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Private, OracleTraceTag.Error, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.FindLastParamByName, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPrivate)
				{
					Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Exit, OracleTraceClassName.OracleParameterCollection, OracleTraceFuncName.FindLastParamByName);
				}
			}
		}
	}
}
